
/*****************************************************************************
 *
 * 作   者: 马婷婷 * 创建时间: 2020/12/15 15:44:39 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

import {DataPacket, NorDataList} from 'pengesoft-ng-lib';

/**
 * 薪酬
 */
export class Salary extends DataPacket {
  Id: number; // 序号
  EmpId: string; // 员工id
  StartSalary: number; // 入职薪酬
  NowSalary: number; // 当前薪酬

  constructor(options: {
    Id?: number;
    EmpId?: string;
    StartSalary?: number;
    NowSalary?: number;
  } = {}) {
    super();
    this.Id = !options.Id ? 0 : Number.parseFloat(options.Id.toString());
    this.EmpId = options.EmpId || '';
    this.StartSalary = !options.StartSalary ? 0 : Number.parseFloat(options.StartSalary.toString());
    this.NowSalary = !options.NowSalary ? 0 : Number.parseFloat(options.NowSalary.toString());
  }
}

/**
 * 薪酬列表
 */
export class SalaryList extends NorDataList<Salary> {

  constructor(options: {
    _Items?: Array<Salary>
  } = {}) {
    super();
    if (options._Items) {
      for (const item of options._Items) {
        this.append(new Salary(item));
      }
    }
  }
}
